-
Notifications
You must be signed in to change notification settings - Fork 5
Add buildCp
tests
#197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add buildCp
tests
#197
Conversation
This PR is exporting some structs that are private in order to call tls.Unmarshall, which I'm goin to delete in the next PR because |
d832cbf
to
15b2c33
Compare
15b2c33
to
820591d
Compare
internal/scti/signatures.go
Outdated
type rfc6962NoteSignature struct { | ||
timestamp uint64 | ||
signature rfc6962.DigitallySigned | ||
type RFC6962NoteSignature struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the struct itself doesn't need to be exported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexported the struct.
Here is the test failure log if the field is unexported.
--- FAIL: TestBuildCp (0.00s)
panic: reflect: reflect.Value.SetUint using value obtained using unexported field [recovered]
panic: reflect: reflect.Value.SetUint using value obtained using unexported field
goroutine 384 [running]:
testing.tRunner.func1.2({0x96f660, 0xc000041b50})
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1734 +0x21c
testing.tRunner.func1()
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1737 +0x35e
panic({0x96f660?, 0xc000041b50?})
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:787 +0x132
reflect.flag.mustBeAssignableSlow(0xaf1b24eac618794b?)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:254 +0xb4
reflect.flag.mustBeAssignable(...)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:244
reflect.Value.SetUint({0x96f860?, 0xc0003f9350?, 0x9eab60?}, 0x15e5c442378)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:2181 +0x45
github.com/transparency-dev/static-ct/internal/types/tls.parseField({0x96f860?, 0xc0003f9350?, 0x930495?}, {0xc0004dc700, 0x74, 0x80}, 0x0, 0xc00052c640)
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:357 +0x838
github.com/transparency-dev/static-ct/internal/types/tls.parseField({0x9d8700?, 0xc0003f9350?, 0x0?}, {0xc0004dc700, 0x74, 0x80}, 0x0, 0x0)
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:435 +0x184b
github.com/transparency-dev/static-ct/internal/types/tls.UnmarshalWithParams({0xc0004dc700, 0x74, 0x80}, {0x959280, 0xc0003f9350}, {0x0?, 0x1?})
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:162 +0xe5
github.com/transparency-dev/static-ct/internal/types/tls.Unmarshal(...)
/usr/local/google/home/rogerng/Git/static-ct/internal/types/tls/tls.go:148
github.com/transparency-dev/static-ct/internal/scti.TestBuildCp(0xc0005896c0)
/usr/local/google/home/rogerng/Git/static-ct/internal/scti/signatures_test.go:430 +0x1b0
testing.tRunner(0xc0005896c0, 0xa7c3f0)
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1792 +0xf4
created by testing.(*T).Run in goroutine 1
/usr/local/google/home/rogerng/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1851 +0x413
Just for the record: I ended up copying over some of c-t-go TLS package in https://github.com/transparency-dev/static-ct/pull/202/files. When we have time, think we can use something a bit neater and simpler, but it works for now, and has been for years. |
Towards #103.